<!--
 * @Description: 
 * @Author: mxy
 * @Date: 2022-11-30 20:38:21
 * @LastEditors: mxy
 * @LastEditTime: 2022-11-30 21:12:58
-->
<template>
  <footer class="footer">
    <!-- This should be `0 items left` by default -->
    <span class="todo-count"
      >剩余<strong>{{ rest }}</strong></span
    >
    <!-- Remove this if you don't implement routing -->
    <ul class="filters">
      <li>
        <a class="selected" href="#/">全部任务</a>
      </li>
      <li>
        <a href="#/active">进行中</a>
      </li>
      <li>
        <a href="#/completed">已完成</a>
      </li>
    </ul>
    <!-- Hidden if no completed items are left ↓ -->
    <button class="clear-completed" @click="$emit('clear')">清除已完成</button>
  </footer>
</template>

<script>
export default {
  props: ["list"],
  computed: {
    rest() {
      return this.list.filter((item) => item.isDone === false).length;
    },
  },
};
</script>

<style>
</style>